﻿/**********************************************************************
 * @file   FITKRadiossAdaptorGravity.h
 * @brief  重力读写适配器
 * @author zhangjingx (hiter25@outlook.com)
 * @date   2025-08-28
 *********************************************************************/
#ifndef __FITKRADIOSSADAPTOGRAVITY_H__
#define __FITKRADIOSSADAPTOGRAVITY_H__
#include "FITKRadiossRadIOAPI.h"
#include "FITKRadiossAbstractAdaptor.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"

namespace Radioss
{
    class FITKGravity;
    /**
     * @brief  重力读写适配器
     * @author zhangjingx (hiter25@outlook.com)
     * @date   2025-08-27
     */
    class FITKRadiossRadIOAPI FITKRadiossAdaptorGravity : public FITKRadiossAbstractAdaptor
    {
    public:
        explicit FITKRadiossAdaptorGravity() = default;
        ~FITKRadiossAdaptorGravity() = default;
        /**
         * @brief
         * @return   QString
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-08
         */
        QString getAdaptorClass() override;
        /**
         * @brief    适配器读取
         * @return   bool
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-08
         */
        bool adaptR() override;
        /**
         * @brief    适配器写出
         * @return   bool
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-07-08
         */
        bool adaptW() override;
    private:
        /**
         * @brief    读取数据
         * @param[i] gravity 
         * @return   bool
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-08-27
         */
        bool readGravity(FITKGravity* gravity);
        /**
         * @brief    读取参数
         * @param[i] lines 
         * @return   void
         * @author   zhangjingx (hiter25@outlook.com)
         * @date     2025-08-27
         */
        void readParam(const QStringList& lines, FITKGravity* gravity);

    };
    /**
     * @brief  注册适配器
     * @author zhangjingx (hiter25@outlook.com)
     * @date   2025-07-09
     */
    Register2FITKIOAdaptorFactory(rad, Radioss::FITKGravity, FITKRadiossAdaptorGravity);
    RegRadiossRadAdaptor(/GRAV, FITKRadiossAdaptorGravity);
}
#endif //!__FITKRADIOSSADAPTOGRAVITY_H__
